-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(RichTextEditor): format toolbar [WPB-12089] #18398
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #18398 +/- ##
==========================================
- Coverage 46.27% 46.19% -0.09%
==========================================
Files 845 861 +16
Lines 26432 26593 +161
Branches 5995 6022 +27
==========================================
+ Hits 12232 12284 +52
- Misses 12665 12770 +105
- Partials 1535 1539 +4 |
…of commenting the issue
src/script/components/InputBar/components/ImageUploadButton/ImageUploadButton.test.tsx
Outdated
Show resolved
Hide resolved
src/script/components/InputBar/components/ImageUploadButton/ImageUploadButton.test.tsx
Outdated
Show resolved
Hide resolved
...script/components/RichTextEditor/components/FormatToolbar/useHeadingState/useHeadingState.ts
Outdated
Show resolved
Hide resolved
...script/components/RichTextEditor/components/FormatToolbar/useToolbarState/useToolbarState.ts
Outdated
Show resolved
Hide resolved
…unnecessary useCallback
> | ||
<ul | ||
className={cx('controls-right buttons-group input-bar-buttons', { | ||
'controls-right-shrinked': textValue.length !== 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'controls-right-shrinked': textValue.length !== 0, | |
'controls-right-shrinked': !!textValue.length, |
onEscape={() => { | ||
if (editedMessage) { | ||
cancelMessageEditing(true); | ||
} else if (replyMessageEntity) { | ||
cancelMessageReply(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe extract to a function
export const FormatTextButton = ({isActive, onClick}: FormatTextButtonProps) => { | ||
return ( | ||
<button | ||
className={cx(`controls-right-button buttons-group-button-left`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
className={cx(`controls-right-button buttons-group-button-left`, { | |
className={cx('controls-right-button buttons-group-button-left', { |
src/script/components/InputBar/hooks/useEmojiPicker/useEmojiPicker.ts
Outdated
Show resolved
Hide resolved
src/script/components/RichTextEditor/components/FormatToolbar/FormatToolbar.tsx
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
Description
A new rich text editor that allows users to edit their message visually before sending it, contains options: heading (h1), bold, italic, strikethrough, lists (ordered & unordered), and code.
Figma Designs
What's changed?
What's missing?
Tests. It turned out, that testing the Lexical-related code isn't simple. It's because of the poor support for the
contenteditable
in JSDOM (issue no.1, and no.2), and lack of other utilities from the Lexical itself, more info. We will add end-to-end tests with QA guidance to ensure the feature works properly.Screenshots/Screencast (for UI changes)
Text formatting:
Screen.Recording.2024-12-03.at.08.01.05.mov
Message editing:
Screen.Recording.2024-12-03.at.08.03.51.mov
Message editing (rich, long):
Screen.Recording.2024-12-04.at.10.24.51.mov
Inserting emoji:
Screen.Recording.2024-12-03.at.08.04.52.mov
Reply to message preview:
Screen.Recording.2024-12-04.at.10.20.37.mov
Default view, large viewport:
Default view, small viewport:
Rich text view, large viewport:
Rich text view, small viewport:
Checklist